package org.railage.server.entities;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Route entity
 * 
 * @author Cyril Fertikov
 * 
 */
@Entity
@Table(name = "route")
public class Route implements Serializable {
	private static final long serialVersionUID = 8156417663788645236L;

	@Id
	@GeneratedValue
	@Column(name = "id")
	private int id;

	@Column(name = "name")
	private String name;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "route")
	private Set<StationOfRoute> stationsOfRoute;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "route")
	private Set<Trip> trips;

	public Route() {

	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<StationOfRoute> getStationsOfRoute() {
		return stationsOfRoute;
	}

	public void setStationsOfRoute(Set<StationOfRoute> stationsOfRoute) {
		this.stationsOfRoute = stationsOfRoute;
	}

	public Set<Trip> getTrips() {
		return trips;
	}

	public void setTrips(Set<Trip> trips) {
		this.trips = trips;
	}

}
